package com.dubbo.test.client;

import com.dubbo.test.service.ServiceAPI;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

public class ConsumerClient {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context
                = new ClassPathXmlApplicationContext("applicationContext.xml");
        context.start();
        while (true){
            Scanner scanner = new Scanner(System.in);
            String message = scanner.next();
            ServiceAPI service = (ServiceAPI)context.getBean("consumerService");
            System.out.println(service.sendMessage(message));
        }
    }
}
